package com.example.system.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.common.utils.R;
import com.example.system.dto.UserDTO;
import com.example.system.entity.Menu;
import com.example.system.entity.User;
import org.quartz.SchedulerException;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author 王鹤蒲
 * @since 2023-07-31
 */
public interface IUserService extends IService<User> {

    public Page<User> selectAll(User user, int currentPage, int pageSize);

    public boolean deleteById(Integer id);

    public boolean deleteByIds(Integer[] ids);

    public boolean updateUser(UserDTO userDTO);

    public void export(User user, HttpServletResponse response) throws UnsupportedEncodingException;

    public User getById(Integer userId);

    public User getUserInfo(UserDTO userDTO);

    public List<Menu> getRoleMenuList(String role);

    public UserDTO getUserByUserName(String userName);

    public UserDTO login(UserDTO userDTO) throws ClassNotFoundException;

    public R sendEmailCode(String email);

    public R verifyEmailCode(String email,String dynamicCode);

    public R save(UserDTO userDTO);

    public R edit(Integer userId, UserDTO userDTO);

    public R isEmailExist(String email);

    public R isPhonenumberExist(String phonenumber);

    public R isUsernameExist(String username);

    public R verifyUserEmail(String userName,String email);

    public R generateCaptchaImage();

    public R verifyPassword(String userName,String originalPassword);

    public R updatePasswordByUserName(String userName,String password);


    public R updateAvatarByUserName(String userName,String avatar);

    public R register(UserDTO userDTO);

    public  User getCurrentLoginUser() ;

    public void export1(HttpServletResponse response);

    public R importExcel(MultipartFile file) throws IOException;

    public R logout();

    public void updateFailedAttempts(String userName) throws ClassNotFoundException, SchedulerException;

    public void clearFailedAttempts(String userName);

    public boolean isAccountLocked(String userName);

    public void generateUserInfomationImportTemplate(HttpServletResponse response);
}
